use http::Method;
use tower_http::cors::CorsLayer;
use tower_http::{
    limit::RequestBodyLimitLayer,
};
pub fn configure_cors() -> CorsLayer {
    CorsLayer::new()
        .allow_origin(["http://localhost:5173".parse().unwrap()])
        .allow_methods([Method::GET, Method::POST])
}

pub fn limit_layer() -> RequestBodyLimitLayer {
    RequestBodyLimitLayer::new(102410240)
}